<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>OrderService UML 类图 - 深度架构分析</title>
    <script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            color: #333;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }

        .header {
            text-align: center;
            margin-bottom: 30px;
            padding: 30px;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }

        .header h1 {
            font-size: 2.5em;
            color: #2c3e50;
            margin-bottom: 10px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        }

        .header p {
            font-size: 1.2em;
            color: #7f8c8d;
            font-weight: 300;
        }

        .diagram-container {
            background: white;
            border-radius: 15px;
            padding: 30px;
            margin: 20px 0;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            overflow-x: auto;
        }

        .diagram-title {
            font-size: 1.5em;
            color: #2c3e50;
            margin-bottom: 20px;
            text-align: center;
            font-weight: 600;
        }

        .plantuml-container {
            text-align: center;
            margin: 20px 0;
        }

        .plantuml-code {
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 8px;
            padding: 20px;
            margin: 20px 0;
            font-family: 'Courier New', monospace;
            font-size: 12px;
            text-align: left;
            overflow-x: auto;
            white-space: pre;
        }

        .analysis-section {
            background: white;
            border-radius: 15px;
            padding: 30px;
            margin: 20px 0;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        }

        .analysis-section h2 {
            color: #2c3e50;
            margin-bottom: 20px;
            font-size: 1.8em;
            border-bottom: 3px solid #3498db;
            padding-bottom: 10px;
        }

        .analysis-section h3 {
            color: #34495e;
            margin: 20px 0 10px 0;
            font-size: 1.3em;
        }

        .pattern-item {
            background: #ecf0f1;
            border-left: 4px solid #3498db;
            padding: 15px;
            margin: 10px 0;
            border-radius: 0 8px 8px 0;
        }

        .pattern-item h4 {
            color: #2980b9;
            margin-bottom: 8px;
        }

        .class-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin: 20px 0;
        }

        .class-item {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            border: 1px solid #dee2e6;
        }

        .class-item h4 {
            color: #495057;
            margin-bottom: 10px;
            font-size: 1.1em;
        }

        .class-item ul {
            list-style-type: none;
            padding-left: 0;
        }

        .class-item li {
            padding: 3px 0;
            font-size: 0.9em;
            color: #6c757d;
        }

        .legend {
            background: #e8f4f8;
            border-radius: 8px;
            padding: 20px;
            margin: 20px 0;
        }

        .legend h3 {
            color: #2c3e50;
            margin-bottom: 15px;
        }

        .legend-item {
            display: flex;
            align-items: center;
            margin: 8px 0;
        }

        .legend-color {
            width: 20px;
            height: 20px;
            margin-right: 10px;
            border-radius: 3px;
            border: 1px solid #ccc;
        }

        .relationship-table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }

        .relationship-table th,
        .relationship-table td {
            border: 1px solid #ddd;
            padding: 12px;
            text-align: left;
        }

        .relationship-table th {
            background-color: #f2f2f2;
            font-weight: 600;
        }

        .relationship-table tr:nth-child(even) {
            background-color: #f9f9f9;
        }

        @media (max-width: 768px) {
            .container {
                padding: 10px;
            }
            
            .header h1 {
                font-size: 2em;
            }
            
            .diagram-container,
            .analysis-section {
                padding: 20px;
            }
            
            .class-list {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="header">
            <h1>🏗️ OrderService UML 类图</h1>
            <p>基于策略模式+工厂模式的支付系统架构深度分析</p>
        </div>

        <!-- Mermaid UML 图 -->
        <div class="diagram-container">
            <div class="diagram-title">📊 交互式类图 (Mermaid)</div>
            <div class="mermaid">
classDiagram
    %% 定义类
    class OrderStrategyTest {
        <<test>>
        -OrderService orderService
        +test() void
    }
    
    class OrderService {
        <<service>>
        -PaymentStrategyFactory paymentStrategyFactory
        +processOrder(Order order) void
        -buildContext(Order order) OrderContext
    }
    
    class PaymentStrategyFactory {
        <<factory>>
        -Map~String,PaymentStrategy~ strategyMap
        +getStrategy(String type) PaymentStrategy
    }
    
    class PaymentStrategy {
        <<interface>>
        +getType() String
        +process() void
    }
    
    class AbstractPaymentStrategy {
        <<abstract>>
        -checkOrderStatus() void
        +invokeRmtInterface() void*
        +executePaymentSpecialLogic() void*
        -updateOrderStatus() void
        +process() void
    }
    
    class AlipayPaymentStrategy {
        <<concrete>>
        +getType() String
        +invokeRmtInterface() void
        +executePaymentSpecialLogic() void
    }
    
    class WechatPaymentStrategy {
        <<concrete>>
        +getType() String
        +invokeRmtInterface() void
        +executePaymentSpecialLogic() void
    }
    
    class DouyinPaymentStrategy {
        <<concrete>>
        +getType() String
        +invokeRmtInterface() void
        +executePaymentSpecialLogic() void
    }
    
    class Order {
        <<entity>>
        -Long orderNo
        -String paymentType
        -BigDecimal paymentAmount
    }
    
    class OrderContext {
        <<context>>
        -Order order
        -String paymentId
        -BigDecimal actualPaymentAmount
    }
    
    class OrderContextHolder {
        <<context>>
        -ThreadLocal~OrderContext~ orderContextTL
        +getOrderContextTL() OrderContext$
        +setOrderContextTL(OrderContext) void$
    }

    %% 关系定义
    OrderStrategyTest ..> OrderService : uses
    OrderStrategyTest ..> Order : creates
    
    OrderService ..> PaymentStrategyFactory : depends
    OrderService ..> PaymentStrategy : uses
    OrderService ..> OrderContext : creates
    OrderService ..> OrderContextHolder : uses
    OrderService ..> Order : processes
    
    PaymentStrategyFactory o-- PaymentStrategy : aggregates
    
    PaymentStrategy <|.. AbstractPaymentStrategy : implements
    AbstractPaymentStrategy <|-- AlipayPaymentStrategy : extends
    AbstractPaymentStrategy <|-- WechatPaymentStrategy : extends
    AbstractPaymentStrategy <|-- DouyinPaymentStrategy : extends
    
    AbstractPaymentStrategy ..> OrderContextHolder : uses
    AbstractPaymentStrategy ..> OrderContext : uses
    AlipayPaymentStrategy ..> OrderContextHolder : uses
    WechatPaymentStrategy ..> OrderContextHolder : uses
    DouyinPaymentStrategy ..> OrderContextHolder : uses
    
    OrderContext o-- Order : contains
    OrderContextHolder *-- OrderContext : composes

    %% 样式定义
    classDef testClass fill:#f0f8ff,stroke:#4682b4,stroke-width:2px
    classDef serviceClass fill:#f0fff0,stroke:#32cd32,stroke-width:2px
    classDef factoryClass fill:#fff0f5,stroke:#ff69b4,stroke-width:2px
    classDef interfaceClass fill:#e6f3ff,stroke:#0066cc,stroke-width:2px
    classDef abstractClass fill:#fffacd,stroke:#ffd700,stroke-width:2px
    classDef concreteClass fill:#f5f5f5,stroke:#696969,stroke-width:2px
    classDef entityClass fill:#f0fff0,stroke:#228b22,stroke-width:2px
    classDef contextClass fill:#ffe4e1,stroke:#cd5c5c,stroke-width:2px

    class OrderStrategyTest testClass
    class OrderService serviceClass
    class PaymentStrategyFactory factoryClass
    class PaymentStrategy interfaceClass
    class AbstractPaymentStrategy abstractClass
    class AlipayPaymentStrategy concreteClass
    class WechatPaymentStrategy concreteClass  
    class DouyinPaymentStrategy concreteClass
    class Order entityClass
    class OrderContext contextClass
    class OrderContextHolder contextClass
            </div>
        </div>

        <!-- PlantUML 源码 -->
        <div class="diagram-container">
            <div class="diagram-title">🎨 PlantUML 源码 (复制到 PlantUML 在线编辑器)</div>
            <div class="plantuml-container">
                <p style="margin-bottom: 10px;">
                    <a href="http://www.plantuml.com/plantuml/uml/" target="_blank" style="color: #3498db; text-decoration: none; font-weight: 600;">
                        🔗 在 PlantUML 在线编辑器中打开
                    </a>
                </p>
            </div>
            <div class="plantuml-code">@startuml OrderService_UML_Diagram
' 样式设置
skinparam {
    classAttributeIconSize 0
    backgroundColor white
    componentStyle rectangle
    linetype ortho
}

' 定义颜色
skinparam class {
    BackgroundColor<<interface>> #E6F3FF
    BorderColor<<interface>> #0066CC
    BackgroundColor<<abstract>> #FFFACD
    BorderColor<<abstract>> #FFD700
    BackgroundColor<<entity>> #F0FFF0
    BorderColor<<entity>> #228B22
    BackgroundColor<<service>> #F0FFF0
    BorderColor<<service>> #32CD32
    BackgroundColor<<factory>> #FFF0F5
    BorderColor<<factory>> #FF69B4
    BackgroundColor<<context>> #FFE4E1
    BorderColor<<context>> #CD5C5C
    BackgroundColor<<test>> #F0F8FF
    BorderColor<<test>> #4682B4
}

' 包定义
package "测试层" #FAFAFA {
    class OrderStrategyTest <<test>> {
        - orderService: OrderService
        + test(): void
    }
}

package "服务层" #F8F8F8 {
    class OrderService <<service>> {
        - paymentStrategyFactory: PaymentStrategyFactory
        + processOrder(order: Order): void
        - buildContext(order: Order): OrderContext
    }
}

package "工厂层" #F8F8F8 {
    class PaymentStrategyFactory <<factory>> {
        - strategyMap: Map<String, PaymentStrategy>
        + PaymentStrategyFactory(strategyMap: Map)
        + getStrategy(type: String): PaymentStrategy
    }
}

package "策略层" #F5F5F5 {
    interface PaymentStrategy <<interface>> {
        + getType(): String
        + process(): void
    }

    abstract class AbstractPaymentStrategy <<abstract>> {
        - checkOrderStatus(): void
        + {abstract} invokeRmtInterface(): void
        + {abstract} executePaymentSpecialLogic(): void
        - updateOrderStatus(): void
        + process(): void
    }

    class AlipayPaymentStrategy <<concrete>> {
        + getType(): String
        + invokeRmtInterface(): void
        + executePaymentSpecialLogic(): void
    }

    class WechatPaymentStrategy <<concrete>> {
        + getType(): String
        + invokeRmtInterface(): void
        + executePaymentSpecialLogic(): void
    }

    class DouyinPaymentStrategy <<concrete>> {
        + getType(): String
        + invokeRmtInterface(): void
        + executePaymentSpecialLogic(): void
    }
}

package "实体层" #F0F0F0 {
    class Order <<entity>> {
        - orderNo: Long
        - paymentType: String
        - paymentAmount: BigDecimal
        + getOrderNo(): Long
        + getPaymentType(): String
        + getPaymentAmount(): BigDecimal
        + setOrderNo(orderNo: Long): void
        + setPaymentType(paymentType: String): void
        + setPaymentAmount(amount: BigDecimal): void
    }
}

package "上下文层" #F0F0F0 {
    class OrderContext <<context>> {
        - order: Order
        - paymentId: String
        - actualPaymentAmount: BigDecimal
        + getOrder(): Order
        + getPaymentId(): String
        + getActualPaymentAmount(): BigDecimal
        + setOrder(order: Order): void
        + setPaymentId(paymentId: String): void
        + setActualPaymentAmount(amount: BigDecimal): void
    }

    class OrderContextHolder <<context>> {
        - {static} orderContextTL: ThreadLocal<OrderContext>
        + {static} getOrderContextTL(): OrderContext
        + {static} setOrderContextTL(context: OrderContext): void
    }
}

' 关系定义
' 依赖关系
OrderStrategyTest .down.> OrderService : "<<uses>>"
OrderStrategyTest .down.> Order : "<<creates>>"

OrderService .down.> PaymentStrategyFactory : "<<depends>>"
OrderService .down.> PaymentStrategy : "<<uses>>"
OrderService .down.> OrderContext : "<<creates>>"
OrderService .down.> OrderContextHolder : "<<uses>>"
OrderService .right.> Order : "<<processes>>"

' 聚合关系
PaymentStrategyFactory o.down. PaymentStrategy : "<<aggregates>>"

' 实现和继承关系
PaymentStrategy <|.down. AbstractPaymentStrategy : "<<implements>>"
AbstractPaymentStrategy <|.down. AlipayPaymentStrategy : "<<extends>>"
AbstractPaymentStrategy <|.down. WechatPaymentStrategy : "<<extends>>"
AbstractPaymentStrategy <|.down. DouyinPaymentStrategy : "<<extends>>"

' 具体策略类的依赖
AbstractPaymentStrategy .right.> OrderContextHolder : "<<uses>>"
AbstractPaymentStrategy .right.> OrderContext : "<<uses>>"

' 上下文关系
OrderContext o.down. Order : "<<contains>>"
OrderContextHolder *-down- OrderContext : "<<composes>>\n(ThreadLocal)"

' 设计模式注释
note top of PaymentStrategy : 策略模式 (Strategy Pattern)\n定义算法家族并使其可互换
note top of PaymentStrategyFactory : 工厂模式 (Factory Pattern)\n封装对象创建逻辑
note top of AbstractPaymentStrategy : 模板方法模式 (Template Method)\n定义算法骨架，子类实现具体步骤
note right of OrderContextHolder : 线程本地存储模式\n(ThreadLocal Pattern)\n确保线程安全的上下文传递

@enduml</div>
        </div>

        <!-- 类关系分析 -->
        <div class="analysis-section">
            <h2>📋 类关系详细分析</h2>
            
            <div class="legend">
                <h3>图例说明</h3>
                <div class="legend-item">
                    <div class="legend-color" style="background: #f0f8ff; border-color: #4682b4;"></div>
                    <span>测试类 (Test Class)</span>
                </div>
                <div class="legend-item">
                    <div class="legend-color" style="background: #f0fff0; border-color: #32cd32;"></div>
                    <span>服务类 (Service Class)</span>
                </div>
                <div class="legend-item">
                    <div class="legend-color" style="background: #fff0f5; border-color: #ff69b4;"></div>
                    <span>工厂类 (Factory Class)</span>
                </div>
                <div class="legend-item">
                    <div class="legend-color" style="background: #e6f3ff; border-color: #0066cc;"></div>
                    <span>接口 (Interface)</span>
                </div>
                <div class="legend-item">
                    <div class="legend-color" style="background: #fffacd; border-color: #ffd700;"></div>
                    <span>抽象类 (Abstract Class)</span>
                </div>
                <div class="legend-item">
                    <div class="legend-color" style="background: #f0fff0; border-color: #228b22;"></div>
                    <span>实体类 (Entity Class)</span>
                </div>
                <div class="legend-item">
                    <div class="legend-color" style="background: #ffe4e1; border-color: #cd5c5c;"></div>
                    <span>上下文类 (Context Class)</span>
                </div>
            </div>

            <h3>🔗 关系类型说明</h3>
            <table class="relationship-table">
                <thead>
                    <tr>
                        <th>关系类型</th>
                        <th>符号</th>
                        <th>描述</th>
                        <th>示例</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>依赖 (Dependency)</td>
                        <td>..></td>
                        <td>一个类使用另一个类</td>
                        <td>OrderService ..> PaymentStrategyFactory</td>
                    </tr>
                    <tr>
                        <td>实现 (Implementation)</td>
                        <td>&lt;|..</td>
                        <td>类实现接口</td>
                        <td>AbstractPaymentStrategy &lt;|.. PaymentStrategy</td>
                    </tr>
                    <tr>
                        <td>继承 (Inheritance)</td>
                        <td>&lt;|--</td>
                        <td>子类继承父类</td>
                        <td>AlipayPaymentStrategy &lt;|-- AbstractPaymentStrategy</td>
                    </tr>
                    <tr>
                        <td>聚合 (Aggregation)</td>
                        <td>o--</td>
                        <td>整体包含部分，部分可独立存在</td>
                        <td>PaymentStrategyFactory o-- PaymentStrategy</td>
                    </tr>
                    <tr>
                        <td>组合 (Composition)</td>
                        <td>*--</td>
                        <td>整体包含部分，部分不可独立存在</td>
                        <td>OrderContextHolder *-- OrderContext</td>
                    </tr>
                </tbody>
            </table>
        </div>

        <!-- 设计模式分析 -->
        <div class="analysis-section">
            <h2>🎯 设计模式深度解析</h2>
            
            <div class="pattern-item">
                <h4>1. 策略模式 (Strategy Pattern)</h4>
                <p><strong>参与角色：</strong></p>
                <ul>
                    <li><code>PaymentStrategy</code> - 策略接口，定义算法族的公共接口</li>
                    <li><code>AbstractPaymentStrategy</code> - 抽象策略类，实现通用逻辑</li>
                    <li><code>AlipayPaymentStrategy, WechatPaymentStrategy, DouyinPaymentStrategy</code> - 具体策略类</li>
                    <li><code>OrderService</code> - 上下文类，使用策略对象</li>
                </ul>
                <p><strong>优势：</strong>算法可以自由切换，符合开闭原则，避免多重条件判断</p>
            </div>

            <div class="pattern-item">
                <h4>2. 工厂模式 (Factory Pattern)</h4>
                <p><strong>参与角色：</strong></p>
                <ul>
                    <li><code>PaymentStrategyFactory</code> - 工厂类，负责创建策略对象</li>
                    <li><code>PaymentStrategy</code> - 产品接口</li>
                </ul>
                <p><strong>优势：</strong>封装对象创建逻辑，客户端无需知道具体实现类</p>
            </div>

            <div class="pattern-item">
                <h4>3. 模板方法模式 (Template Method Pattern)</h4>
                <p><strong>参与角色：</strong></p>
                <ul>
                    <li><code>AbstractPaymentStrategy</code> - 抽象模板类，定义算法骨架</li>
                    <li>具体策略类 - 实现模板方法中的抽象步骤</li>
                </ul>
                <p><strong>算法步骤：</strong>1) 检查订单状态 → 2) 调用远程接口 → 3) 执行特殊逻辑 → 4) 更新订单状态</p>
                <p><strong>优势：</strong>固定算法结构，避免代码重复，便于维护</p>
            </div>

            <div class="pattern-item">
                <h4>4. 线程本地存储模式 (ThreadLocal Pattern)</h4>
                <p><strong>参与角色：</strong></p>
                <ul>
                    <li><code>OrderContextHolder</code> - 持有ThreadLocal变量</li>
                    <li><code>OrderContext</code> - 上下文数据</li>
                </ul>
                <p><strong>优势：</strong>确保线程安全的上下文传递，避免参数层层传递</p>
            </div>
        </div>

        <!-- 类详细信息 -->
        <div class="analysis-section">
            <h2>📝 类详细信息</h2>
            
            <div class="class-list">
                <div class="class-item">
                    <h4>OrderStrategyTest</h4>
                    <ul>
                        <li>测试类</li>
                        <li>验证支付策略的正确性</li>
                        <li>依赖注入 OrderService</li>
                    </ul>
                </div>

                <div class="class-item">
                    <h4>OrderService</h4>
                    <ul>
                        <li>业务服务类</li>
                        <li>订单处理的入口</li>
                        <li>负责上下文构建和策略调用</li>
                    </ul>
                </div>

                <div class="class-item">
                    <h4>PaymentStrategyFactory</h4>
                    <ul>
                        <li>策略工厂类</li>
                        <li>Spring自动注入策略实现</li>
                        <li>根据类型返回对应策略</li>
                    </ul>
                </div>

                <div class="class-item">
                    <h4>PaymentStrategy</h4>
                    <ul>
                        <li>策略接口</li>
                        <li>定义支付算法的统一接口</li>
                        <li>getType() 和 process() 方法</li>
                    </ul>
                </div>

                <div class="class-item">
                    <h4>AbstractPaymentStrategy</h4>
                    <ul>
                        <li>抽象策略类</li>
                        <li>实现模板方法模式</li>
                        <li>定义通用流程和抽象方法</li>
                    </ul>
                </div>

                <div class="class-item">
                    <h4>具体策略类</h4>
                    <ul>
                        <li>AlipayPaymentStrategy - 支付宝支付</li>
                        <li>WechatPaymentStrategy - 微信支付</li>
                        <li>DouyinPaymentStrategy - 抖音支付</li>
                        <li>各自实现特定的支付逻辑</li>
                    </ul>
                </div>

                <div class="class-item">
                    <h4>Order</h4>
                    <ul>
                        <li>订单实体类</li>
                        <li>包含订单号、支付类型、金额</li>
                        <li>使用Lombok @Data注解</li>
                    </ul>
                </div>

                <div class="class-item">
                    <h4>OrderContext</h4>
                    <ul>
                        <li>订单上下文类</li>
                        <li>携带处理过程中的状态信息</li>
                        <li>包含订单、支付ID、实际金额</li>
                    </ul>
                </div>

                <div class="class-item">
                    <h4>OrderContextHolder</h4>
                    <ul>
                        <li>上下文持有者</li>
                        <li>基于ThreadLocal实现</li>
                        <li>确保线程安全的上下文传递</li>
                    </ul>
                </div>
            </div>
        </div>

        <!-- 架构优势分析 -->
        <div class="analysis-section">
            <h2>🚀 架构优势与特点</h2>
            
            <div class="pattern-item">
                <h4>1. 高度可扩展性</h4>
                <p>新增支付方式只需实现PaymentStrategy接口，符合开闭原则</p>
            </div>

            <div class="pattern-item">
                <h4>2. 职责清晰</h4>
                <p>每个类都有明确的职责，服务类负责流程控制，工厂类负责对象创建，策略类负责具体算法</p>
            </div>

            <div class="pattern-item">
                <h4>3. 线程安全</h4>
                <p>通过ThreadLocal确保并发环境下上下文数据的线程安全</p>
            </div>

            <div class="pattern-item">
                <h4>4. 松耦合设计</h4>
                <p>通过接口和依赖注入实现松耦合，便于单元测试和mock</p>
            </div>

            <div class="pattern-item">
                <h4>5. Spring集成友好</h4>
                <p>充分利用Spring的依赖注入和Bean管理机制</p>
            </div>
        </div>

        <div style="text-align: center; margin-top: 40px; padding: 20px; background: rgba(255,255,255,0.9); border-radius: 10px;">
            <p style="color: #7f8c8d; font-size: 0.9em;">
                ⚡ 本UML图展示了基于策略模式+工厂模式的支付系统完整架构 ⚡<br>
                📊 生成于: <span id="timestamp"></span>
            </p>
        </div>
    </div>

    <script>
        // 初始化 Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            themeVariables: {
                primaryColor: '#f0f8ff',
                primaryTextColor: '#333',
                primaryBorderColor: '#4682b4',
                lineColor: '#666',
                sectionBkgColor: '#f9f9f9',
                altSectionBkgColor: '#ffffff',
                gridColor: '#e6e6e6'
            },
            flowchart: {
                curve: 'basis',
                htmlLabels: true
            },
            classDiagram: {
                htmlLabels: true
            }
        });

        // 设置时间戳
        document.getElementById('timestamp').textContent = new Date().toLocaleString('zh-CN');

        // 添加复制功能
        function copyPlantUML() {
            const plantUMLCode = document.querySelector('.plantuml-code').textContent;
            navigator.clipboard.writeText(plantUMLCode).then(() => {
                alert('PlantUML 代码已复制到剪贴板！');
            });
        }
    </script>
</body>
</html>